<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>'添加考勤规则设置'))}
	<input type="hidden" id="return_id" name="return_id" >
	<input type="hidden" id="return_name" name="return_name">
	<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"  >
		<input type="hidden" id="ajax" name="ajax" value="0">
		<input type="hidden" id="opmode" name="opmode" value="add">
		<input type="hidden" name="actor" id="actor">
		<input id="longitude" name="longitude" type="hidden" style="width:100px; margin-right:10px;" value="120.388942"/>
		<input id="latitude" name="latitude" type="hidden" style="width:100px; margin-right:10px;" value="36.073379" />
		
			<label class="input-label" for="name">规则名称*：</label>
			
				<input class="input" type="text" id="name" name="name" check="required" info="请输入名称">
			</div>
		</div>
		
			<label class="input-label" for="name">对应审批单*：</label>
			
				<select id="flow_type" name="flow_type" class="input col-15"　 check="required" info="请输入名称">
					{:fill_option($flow_type_list)};
				</select>
			</div>
		</div>
		
			<label class="input-label" for="start_date">开始日期字段*：</label>
			
				<div class="input-group ">
					<input name="start_date_field_name"  id="start_date_field_name" class="input" type="text" info="请选择开始日期字段" check="required" readonly="readonly" />
					<input name="start_date_field_id" id="start_date_field_id" type="hidden" info="请选择开始日期字段" check="required" />
					<div class="input-group-btn">
						<a class="btn" onclick="select_start_date();" > <i class="fa fa-search" ></i> </a>
					</div>
				</div>
			</div>
		</div>
		
		
			<label class="input-label" for="end_date">结束日期字段*：</label>
			
				<div class="input-group ">
					<input name="end_date_field_name" id="end_date_field_name" class="input" type="text" info="请选择结束日期字段" check="required" readonly="readonly" />
					<input name="end_date_field_id" id="end_date_field_id" type="hidden" info="请选择结束日期字段" check="required" />
					<div class="input-group-btn">
						<a class="btn" onclick="select_end_date();" > <i class="fa fa-search" ></i> </a>
					</div>
				</div>
			</div>
		</div>
		
			<div class="action input-block">
				<a class="btn btn-normal" onclick="save()">保存</a>
				<a class="btn btn-return"onclick="go_return_url();">取消</a>
			</div>
		</div>
	</form>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use('global', function() {
			var $ = layui.jquery;
			
			function select_start_date() {
				$('#return_id').val('start_date_field_id');
				$('#return_name').val('start_date_field_name');
				$flow_type=$('#flow_type').val();
				winopen(fix_url('{:url("udf_field")}?flow_type='+$flow_type), 560, 470);
			}
			
			function select_end_date() {
				$('#return_id').val('end_date_field_id');
				$('#return_name').val('end_date_field_name');		
				$flow_type=$('#flow_type').val();
				winopen(fix_url('{:url("udf_field")}?flow_type='+$flow_type), 560, 470);
			}
			
			function save() {
				send_form("form_data", "{:url('save')}");
			}
		});
	</script>
</block>